#include <string.h>

void extractDomain(char *url, char *domain) {
    char *start = strstr(url, "://");
    if (start != NULL) {
        start += 3;  // 移动到 "://" 后面的字符
        char *end = strchr(start, '/');
        if (end == NULL) {
            end = start + strlen(start);
        }

        // 复制域名部分
        strncpy(domain, start, end - start);
        domain[end - start] = '\0';
    }
}
